<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%   
String path = request.getContextPath();   
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";   
%> 
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
	<title>xesj</title>
	<%-- <jsp:include page="../../../../inc/bootstrap.jsp"></jsp:include> --%>
	<meta name="viewport" content="width=device-width,height=device-height, initial-scale=1.0">
	<!-- 设置字符编码集为国际编码 -->
	<meta charset="utf-8">
	<!-- IE兼容模式 通知 IE 采用其所支持的最新的模式 -->
	<meta http-equiv="X-UA-Compatible" content="IE=Edge">
	<!-- 360,qq浏览器等多核浏览器，优先采用webkit -->
	<meta name="renderer" content="webkit">
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">
	<meta http-equiv="keywords" content="xesj">
	<meta http-equiv="description" content="xesj">
	<link rel="icon" type="image/x-ico" href="<%=basePath %>static/images/logo_icon.jpg"> 
	<!-- 引入 Bootstrap -->
	<link href="<%=basePath %>static/bootstrap-3.3.5-dist/css/bootstrap.min.css" rel="stylesheet">
	<link rel="stylesheet" href="<%=basePath %>static/css/index.css" />
	<!-- HTML5 Shim 和 Respond.js 用于让 IE8 支持 HTML5元素和媒体查询 -->
	<!-- 注意： 如果通过 file://  引入 Respond.js 文件，则该文件无法起效果 -->
	<!--[if lt IE 9]>
		 <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
		 <script src="https://oss.maxcdn.com/libs/respond.js/1.3.0/respond.min.js"></script>
	<![endif]-->
	<!-- jQuery (Bootstrap 的 JavaScript 插件需要引入 jQuery) -->
	<script src="<%=basePath %>static/js/jquery-1.11.3.min.js"></script>
	<!-- 包括所有已编译的插件 -->
	<script src="<%=basePath %>static/bootstrap-3.3.5-dist/js/bootstrap.min.js"></script>
	<script type="text/javascript">var iframe_h = 0;var diag = {}; var diag2 = {};var maxModalIndex = "999999999";</script>
	<script type="text/javascript" src="<%=basePath%>static/js/maxRemind/maxRemind.js" ></script>
	<script src="<%=basePath %>static/js/index.js" type="text/javascript"></script>
	<script src="<%=basePath %>static/js/util.js" type="text/javascript"></script>
	<script src="<%=basePath %>static/js/maxModal/maxModal.js" type="text/javascript"></script>
</head>
<body>
	<!-- nav start -->
   	<div id="wtl_nav" class="clearfix">
	  	<div class="pull-left">
	  		<div class="pull-left logobox"><div class="logo"></div></div><div class="pull-left project_name">O2O管理系统</div>
	   	</div>
	   	<div class="pull-right text-right" id="manager_menu">
	   		<div class="mm_item">管理员:<span class="admin_name">${sessionUser.username}</span></div><div class="mm_item">所属机构:<span class="admin_name">${sessionUser.orgname}</span></div><c:if test="${sessionUser.generalname != null}"><div class="mm_item">总部:<span class="admin_name">${sessionUser.generalname}</span></div></c:if><div class="mm_item" onclick="goEdit();">个人信息</div><div class="mm_item" onclick="goModPwd();">修改密码</div><div class="mm_item" onclick="loginout();">退出</div>
	   	</div>
   	</div>
	<!-- nav end -->
	<!-- wtl_con start -->
	<div id="wtl_con">
		<!-- wtl_leftMenu start -->
		<div id="wtl_leftMenu">
			<div id="slider_btn">
				<span>|||</span>
			</div>
			<!-- slider start -->
			<div id="slider">
				<!-- #slider内容部分 -->
				<div id="scrHeight" class="overflow-hidden">
					<ul id="menuBar">
						<li class="selActive active">
							<a href="javascript:void(0);"  data-url="<%=basePath %>toIndex.do" data-title="首页">
								<span class="icon_left"><i class="glyphicon glyphicon-home"></i></span>
								<span class="icon_name">首页</span>
							</a>
						</li>
						<c:forEach items="${sessionUser.menus }" var="menus" varStatus="vs">
							<li class="selActive">
								<a data-toggle="collapse" href="#collapse${vs.index+1}" data-title="${menus.permission_name }">
									<span class="icon_left"><i class="${menus.permission_icon }"></i></span>
									<span class="icon_name">${menus.permission_name }</span>
								</a>
								<div class="collapse mt3" id="collapse${vs.index+1}">
									<ul class="list-unstyled">
										 <c:forEach items="${menus.subPermission }" var="menus2">     
											 <li class="sub_li">
											 	<a href="javascript:void(0);" <c:if test="${menus2.permission_url != '#'}">data-url='<%=basePath%>${menus2.permission_url }'</c:if> data-title="${menus2.permission_name }">
											 		<span class="icon_left"><i class="${menus2.permission_icon }"></i></span>
											 		<span class="icon_name">${menus2.permission_name }</span>
											 	</a>
											 </li> 
										 </c:forEach>
									</ul>
								</div>
							</li>
						</c:forEach> 
					</ul>
					<!-- #slider滚动条部分 -->
					<div id="scrBar" class="scrBar clearfix">
						<div class="scrSlider" id="scrSlider"></div>
					</div>
				</div>
			</div>
		</div>
		<div id="tab_list">
			<div id="tabnav">
			  <ul id="tabnav_l" class="nav nav-tabs" role="tablist">
			    <li class="active"><a href="#home" data-toggle="tab">首页</a></li>
			    <!-- <li><a href="#tab1" data-toggle="tab">Profile<i class='glyphicon glyphicon-remove'></i></a></li>
			    <li><a href="#tab2" data-toggle="tab">Messages<i class='glyphicon glyphicon-remove'></i></a></li>
			    <li><a href="#tab3" data-toggle="tab">Settings<i class='glyphicon glyphicon-remove'></i></a></li> -->
			  </ul>
			  <div id="tabnav_panl" class="tab-content">
			    <div class="tab-pane active" id="home">
			    	<iframe id="mainLayFrame" src="<%=basePath%>showIndex.do" width="100%" frameborder="0"></iframe>
			    </div>
			  </div>
				
				<div id="excutabnav">
					<div class="btn-group">
					  <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">其他<span class="caret"></span></button>
					  <ul class="dropdown-menu pull-right">
					    <li><a href="javascript:void(0);">首页</a></li>
					  </ul>
					</div>
				</div>
			</div>
			
			<%-- <iframe id="mainLayFrame" src="<%=basePath%>showIndex.do" width="100%" frameborder="0"></iframe> --%>
		</div>
	</div>
  		<div id="wtl_footer">
		Copyright © 深圳市旺商宝科技有限公司. All Rights Reserved
	</div>
	
  	<script>
  	 var basePath = "<%=basePath%>"
  	//测试
  	<%-- $.getJSON("<%=basePath%>data/tree_data.json",function(data){
  		data.forEach(function(val ,index){
  			var html ='<li class="selActive">'+
		  				'<a data-toggle="collapse" href="#collapse'+val.id+'" data-title="'+val.text+'">'+
							'<span class="icon_left"><b class="caret_right"></b></span>'+
							'<span class="icon_name">'+val.text+'</span>'+
						'</a>'+
						'<div class="collapse mt3" id="collapse'+val.id+'">'+
							'<ul class="list-unstyled">';
			val.children.forEach(function(item){
				html += '<li class="sub_li">'+
						 	'<a href="javascript:void(0);" data-url='+basePath+item.src+' data-title="'+item.text+'">'+
					 		'<span class="icon_left"><i class="glyphicon glyphicon-plus"></i></span>'+
					 		'<span class="icon_name">'+item.text+'</span>'+
					 	'</a>'+
					 '</li>'; 
			});
			html += '</ul></div></li>'
	  		$("#menuBar").append(html);
  		})
  	}); --%>
  	//退出
  	function loginout(){
  		window.location.href = "<%=basePath %>logout.do";
  	}
  	
  	//去修改密码界面
	function goModPwd(){
	  	top.diag = $.MaxDialog({
			"id":"user_modpwd",
			"width":400,
			"height":200,
			"title":"密码修改",
			"type":"iframe",
			"isFooter":false,
			"url":"<%=basePath%>userController/goModPwdView.do",
			"buttons":[
				{
					"text":"保存",
					"callback":function(){
						/* $.MaxDialog({
							//"type":"iframe",
							//"content":"我是确定按钮的回调函数，我有return false时，不关闭模态框",
						})  */
						//alert("我是确定按钮的回调函数，我有return false时，不关闭模态框")
						//return false;
						
					}
				},
				{
					"text":"取消",
					"type":"Mcancel",
					"callback":function(){
						//alert("我是取消按钮的回调函数，我没有return false时，关闭模态框");
						//return false时，不关闭模态框
					}
				}
			]
		})
	}
	//去修改用户
	function goEdit(){
	  	top.diag = $.MaxDialog({
			"id":"user_modify2",
			"width":510,
			"height":380,
			"title":"用户编辑",
			"type":"iframe",
			"isFooter":false,
			"url":"<%=basePath%>userController/goEditPerson.do?USER_ID="+'${sessionUser.userid}',
			"buttons":[
				{
					"text":"保存",
					"callback":function(){
						/* $.MaxDialog({
							//"type":"iframe",
							//"content":"我是确定按钮的回调函数，我有return false时，不关闭模态框",
						})  */
						//alert("我是确定按钮的回调函数，我有return false时，不关闭模态框")
						//return false;	
					}
				},
				{
					"text":"取消",
					"type":"Mcancel",
					"callback":function(){
						//alert("我是取消按钮的回调函数，我没有return false时，关闭模态框");
						//return false时，不关闭模态框
					}
				}
			]
		})
	}
  	</script>
  	</body>
</html>
